package com.artqiyi.dollmachine.presenter;

import android.content.Intent;

import com.artqiyi.dollmachine.common.constant.ServerConstant;
import com.artqiyi.dollmachine.common.constant.UserConfigConstant;
import com.artqiyi.dollmachine.model.entity.CoinBuyBean;
import com.artqiyi.dollmachine.presenter.base.BasePresenter;
import com.artqiyi.dollmachine.presenter.base.PresenterCallbackCollection;
import com.artqiyi.dollmachine.utils.Callback.MyStringCallback;
import com.artqiyi.dollmachine.utils.JSONUtils;
import com.artqiyi.dollmachine.utils.manager.ActivityManager;
import com.artqiyi.dollmachine.utils.manager.HttpManager;
import com.artqiyi.dollmachine.utils.manager.UserInfoManager;
import com.artqiyi.dollmachine.utils.respone.PaymentRespone;
import com.artqiyi.dollmachine.views.activity.LoginActivity;
import com.artqiyi.dollmachine.views.activity.MineActivity;

import java.util.HashMap;
import java.util.Map;

import okhttp3.Call;
import timber.log.Timber;

/**
 * Created by Administrator on 2017/11/29 0029.
 */

public class MinePresenter extends BasePresenter{
    public void doLogout() {
        HttpManager.postHttpRequest(ServerConstant.logout(), null, new MyStringCallback() {
            @Override
            public void onError(Call call, Exception e, int id) {
                Timber.d(e.toString());
            }

            @Override
            public void onResponse(String response, int id) {
                Timber.d(response);
                ActivityManager.getAppManager().finishAllActivity();
                UserConfigConstant.setToken("");
                mContext.startActivity(new Intent(mContext, LoginActivity.class));
            }
        });
    }
}
